<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单详情页</title>
    <script src="${path}/user/test01/js/jquery-3.6.0.js"></script>
    <link rel="stylesheet" href="${path}/user/test01/lib/bootstrap-3.4.1-dist/css/bootstrap.css">
    <link rel="stylesheet" href="${path}/user/test01/css/new.css">
    
</head>
<body>
<jsp:include page="${path}/user/test03/normal/head.jsp"></jsp:include>
    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <h3 class="text-center">
                    订单信息
                </h3>
                <table class="table table-bordered table-hover">
                    <thead>
                        <tr>
                            <th>
                                订单编号
                            </th>
                            <th>
                                姓名
                            </th>
                            <th>
                                航班号
                            </th>
                            <th>
                                航线号
                            </th>
                            <th>
                                出发地
                            </th>
                            <th>
                                目的地
                            </th>
                            <th>
                                出发日期
                            </th>
                            <th>
                                到达日期
                            </th>
                            <th>
                                出发时间
                            </th>
                            <th>
                                到达时间
                            </th>
                            <th>
                                票价
                            </th>
                            <th>
                                支付状态
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                    </thead>
                    <c:choose>
                        <c:when test="${empty orders}">
                            <tr><td colspan="11" align="center">没有订单</td></tr>
                        </c:when>
                        <c:otherwise>
                            <c:forEach var="order" items="${orders}">
                                <tr>
                                    <td >
                                            ${order.bookId}
                                    </td>
                                    <td>
                                            ${order.name}
                                    </td>
                                    <td>
                                            ${order.flightNo}
                                    </td>
                                    <td>
                                            ${order.airlineNo}
                                    </td>
                                    <td>
                                            ${order.origin}
                                    </td>
                                    <td>
                                            ${order.destination}
                                    </td>
                                    <td>
                                            ${order.leave}
                                    </td>
                                    <td>
                                            ${order.arrive}
                                    </td>
                                    <td>
                                            ${order.leaveTime}
                                    </td>
                                    <td>
                                            ${order.arriveTime}
                                    </td>
                                    <td>
                                            ${order.ticketPrice}
                                    </td>
                                    <td>
                                            ${order.paydastatus == 1 ? "已支付" : "未支付"}
                                    </td>
                                    <td>
                                        <input type="button"  value="退票" id="btn1" onclick="queryOrderByBookId('${order.bookId}')"/>
                                        <input type="button"  value="改签" id="btn2" />
                                        <input type="button"  value="支付" id="btn3" />
                                        <span>
                                            <c:forEach items="${bookIds}" var="bid">
                                                <c:if test="${order.bookId==bid}">
                                                    <p>正在退票中</p>
                                                </c:if>

                                            </c:forEach>
                                        </span>
                                    </td>
                                </tr></c:forEach>
                        </c:otherwise>
                    </c:choose>


                </table>
            </div>
        </div>
    </div>
<jsp:include page="${path}/user/test03/normal/footer.jsp"></jsp:include>

<script type="text/javascript">
    function queryOrderByBookId(bookId) {
        location.href="${path}/OrderServlet?mark=queryOrderByBookId&bookId="+bookId;
    }
</script>

</body>
</html>